Skip to content
QtWS25 Last Chance
  • 0 Votes
    54 Posts
    22k Views
    RatzzR
    @mrjj cheating works fine :)
  • 0 Votes
    2 Posts
    968 Views
    p3c0P
    @dzimiwine Did you try acceptedButtons ? acceptedButtons: Qt.MiddleButton : Qt.RightButton
  • 0 Votes
    2 Posts
    919 Views
    SGaistS
    Hi, You should be able to do it on the drop event. There you can check whether you already have an element corresponding to what is being dropped and you can use a QDialog to ask the question to your user. Hope it helps
  • 0 Votes
    2 Posts
    2k Views
    mrjjM
    Hi and welcome Maybe void QDrag::setPixmap(const QPixmap & pixmap) Could be used ? You set it when you start the drag so it sounds it might do what you want.
  • 0 Votes
    5 Posts
    2k Views
    mrjjM
    @Yaseen Well there are many samples and I stumbled on this one a day where I typed Widget in the search field to see all samples for Desktop / not Qt Quick . :)
  • 0 Votes
    6 Posts
    7k Views
    CharbyC
    @Aleksey_K if all you need is to get the gantt generated and displayed, you could also have a look to taskjuggler project which I found to be extremely powerful.
  • 0 Votes
    1 Posts
    713 Views
    No one has replied
  • 0 Votes
    1 Posts
    2k Views
    No one has replied
  • 0 Votes
    1 Posts
    2k Views
    No one has replied
  • 0 Votes
    2 Posts
    4k Views
    CybrumC
    I found a solution. I followed the below Steps: 1.Created a QtCreator Extension Plugin 2.In Pro file: Add uri = mycompany.qmlcomponents version =1.0 3.Added my CustomControl QML file. 4.Registered using qmlRegisterType 5.In qml dir: module mycompany.qmlcomponents plugin MyExtensionPlugin classname MyExtensionPlugin typeinfo mycompany.qmlcomponents designersupported 5.Wrote the MetaInfo file (myextensionplugin.metainfo): MetaInfo { Type { name: "mycompany.qmlcomponents.MyCustomItem" icon: "images/customitem-icon.png" ItemLibraryEntry { name: "CustomItem" category: "My Extension - Items" libraryIcon: "images/customitem-icon.png" version: "1.0" requiredImport: "mycompany.qmlcomponents" Property { name: "itemItext" type: "binding" value: "qsTr(\"Button\")" } } } } 6.Create a designer folder 7.Add following to designer.pri QML_FILES += $$PWD/CustomItemSpecifics.qml QML_FILES += $$PWD/myextensionplugin.metainfo QML_FILES += $$PWD/images/customitem-icon.png 8.Build and install 9.Generate qmltypes: [You can also do this during qmake] qmlplugindump mycompany.qmlcomponents1.0 > plugins.qmltypes 10.The controls will be available in the qml designer. Check the unsupported properties for custom controls: http://doc.qt.io/qtcreator/creator-quick-ui-forms.html
  • 0 Votes
    5 Posts
    2k Views
    S
    @SGaist thanks for answering my question, i will learn qt quick to do this
  • drag and drop in Qt4

    Mobile and Embedded drag and drop
    5
    0 Votes
    5 Posts
    1k Views
    A
    @SGaist You mean Qt4.8.6, the latest of Qt4, right? Well, the Qt4.8.5 I talked about, it was compiled by atmel, not myself. The thing is, atmel managed to combine the Qt libraries into the cross-compiler. I've no idea how they did it or the connections between them. And, let's just say I'm not familiar with Qt core things or anywhere near it. So after I simply replaced the Qt libraries and the fonts, I tried to compile the app I wrote. It didn't work. It said a symbol link in the cross-compiler directory, ld, couldn't find something(sorry, I forgot). But I do manage to try Qt4.8.6 using another cross-compiler without so much atmel drama, the Qt libraries is isolated. The drag-drop works fine, no that icon I've talked about is shown. But given the atmel part that I don't understand, I can't be 100% certain that it's Qt's bug. But atmel's FAE did say they wouldn't have so many people to change Qt or something.
  • 0 Votes
    1 Posts
    872 Views
    No one has replied
  • 0 Votes
    1 Posts
    491 Views
    No one has replied
  • Drag and drop buttons

    General and Desktop drag and drop qpushbutton
    2
    0 Votes
    2 Posts
    939 Views
    D
    ^^^ this issue persists. How do I create a new object in the dropEvent (to mimic 'moving' an object) and have it be created to the parent's widget? As it stands (with this as a parameter) it creates the new label on the widget that received the dropEvent.
  • 0 Votes
    3 Posts
    3k Views
    S
    @p3c0 This isn't what i'm trying to do. Setting the whole item as the drag.target would make the item follow the cursor and since the item can't be drawn outside of the Qml scene it would clip as soon as the pointer leaves the dock. I use a non visual "draggable" Item to be the drag.target like in the externaldraganddrop example. I tried what you suggested and noticed something strange however. Inside a QQuickWidget : the item will not follow the cursor during the drag and drop but follow it after the user releases the mouse button ("locking" the mouse in the process). MouseArea.onReleased is not called after the drag and drop. Inside a full Qml application : the item will not follow the cursor during the drag and drop but move to the cursor when the user releases the mouse button. MouseArea.onReleased is called after the drag and drop. Edit : I just found a bug report for the same behavior (https://bugreports.qt.io/browse/QTBUG-40773).
  • 0 Votes
    4 Posts
    2k Views
    SGaistS
    It's described here
  • 1 Votes
    11 Posts
    8k Views
    W
    Inside the QTableWidget, I'm guessing I'll have ~100 of my custom widgets at most. In other use cases (i.e. not in the QTableWidget, but in static layouts), I've had up to 4000 of these widgets, with a few hundred being active (i.e. actively refreshing their data from the backend) at the same time, without any serious performance issues, so I know it scales relatively well. Also, to elaborate on the solution I offered above: cloning the custom widget proved difficult, because it has a lot of properties (I simplified the problem, the "custom widget" is actually a family of different widgets to fit different data), and because copying Qt objects is not trivial (see http://doc.qt.io/qt-5/object.html#identity-vs-value). What I ended up doing was write a ContainerWidget to go along the GridWidget. The ContainerWidget has a layout with no margins and is used to display another widget through a setContainedWidget() method. I also added a cloneAndPassContainedWidget() method that does what you'd expect: it returns a new ContainerWidget and gives it ownership of the contained widget. Obviously, after calling the method the original ContainerWidget becomes useless, but the method is called precisely because the original ContainerWidget is set to be destroyed, so that's not a problem. I can now use my GridWidget to display any kind of widgets, it's pretty neat! (I wrote "widget" too many times!) I realize the "proper" way would have been to write a model, views, and delegates, but that would have required a lot more work. EDIT: Here's my updated solution: https://gist.github.com/anonymous/a3b2d7e61c6b3e11742c